import request from '@/config/axios'

// 店员动态 VO
export interface TrendVO {
  id: number // 编号
  workerClerkId: number // 店员编号
  city: string // 城市
  userId: number // 用户编号
  content: string // 内容
  file: string // 附件
  fileType: boolean // 附件类型
  weight: number // 排序
  seconds: number // 时长/秒
  like: number // 喜欢
  status: boolean // 状态
}

// 店员动态 API
export const TrendApi = {
  // 查询店员动态分页
  getTrendPage: async (params: any) => {
    return await request.get({ url: `/worker/trend/page`, params })
  },

  // 查询店员动态详情
  getTrend: async (id: number) => {
    return await request.get({ url: `/worker/trend/get?id=` + id })
  },

  // 新增店员动态
  createTrend: async (data: TrendVO) => {
    return await request.post({ url: `/worker/trend/create`, data })
  },

  // 修改店员动态
  updateTrend: async (data: TrendVO) => {
    return await request.put({ url: `/worker/trend/update`, data })
  },

  // 删除店员动态
  deleteTrend: async (id: number) => {
    return await request.delete({ url: `/worker/trend/delete?id=` + id })
  },

  // 导出店员动态 Excel
  exportTrend: async (params) => {
    return await request.download({ url: `/worker/trend/export-excel`, params })
  },
}